package com.smec.remes.module.query;

import android.content.Context;

import com.smec.remes.base.SmecBasePresenter;
import com.smec.remes.bean.SubmitDetails;
import com.smec.remes.bean.SubmitFinish;
import com.smec.remes.bean.SubmitSure;
import com.smec.remes.bean.query.PackingList;
import com.smec.remes.bean.query.Stock;
import com.smec.remes.smecManager.SmecRetrofit.BaseSubscriber;
import com.smec.remes.smecManager.SmecRetrofit.HttpResult;

import java.util.ArrayList;
import java.util.HashMap;

import rx.Observable;

/**
 * Created by Administrator on 2017/12/18.
 */

public class SmecQueryPresenter extends SmecBasePresenter {
    public SmecQueryPresenter(Context mContext) {
        super(mContext);
    }

    public void _queryList(String mantr,String mantrName,String wareHouse,String wareHouseName) {
        HashMap<String, Object> map = new HashMap<>();
        map.put("Matnr", mantr);
        map.put("MatnrName", mantrName);
        map.put("WarehouseNo", wareHouse);
        map.put("WarehouseName", wareHouseName);
        map.put("PageNum", "5");
        map.put("PageSize", "1");
        Observable<HttpResult<ArrayList<Stock>>> observable=smecPackingService._QueryList(map);
        schedulerThread(observable).subscribe(new BaseSubscriber<HttpResult<ArrayList<Stock>>>() {
            @Override
            public void onNext(HttpResult<ArrayList<Stock>> arrayListHttpResult) {

            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
            }
        });
    }

    public void _packingList(String arg0,int arg1){
        HashMap<String, Object> map = new HashMap<>();
        map.put("arg0", arg0);
        map.put("arg1", arg1);

        Observable<HttpResult<ArrayList<PackingList>>> observable=smecPackingService._QueryPacking(map);
        schedulerThread(observable).subscribe(new BaseSubscriber<HttpResult<ArrayList<PackingList>>>() {
            @Override
            public void onNext(HttpResult<ArrayList<PackingList>> arrayListHttpResult) {

            }

            @Override
            public void onError(Throwable e) {
                super.onError(e);
            }
        });
    }
}
